#pragma once
#include "thread.h"
#include "ProtoDef.h"

class CWordThread
	: public CThread
{
public:
	CWordThread(void);
	~CWordThread(void);

private:
	virtual void	Execute(LPVOID pParam);

public:
	void		SetConfig(WPARAM wParam, LPARAM lParam);
	void		GetAllVersionInfo(WPARAM wParam, LPARAM lParam);
	void		GetOneVersion(WPARAM wParam, LPARAM lParam);
	void		CheckNewVersion(WPARAM wParam, LPARAM lParam);

private:
	int			TraverseDirectory(MapVersionBriefInfo& mapInfo, CString strDirPath);
	int			GetFileVersionID(CString strDirPath, CString strFileName);
	bool		CheckFileName(DWORD dwVersionID, CString strFileName);
	int			ConvertFourNumber(CString strNumber);
	CString		GetDirName(CString strDirPath);
	CString		GetExtractPath();
	BOOL		ExtractZip(CString strFilePath, CString strExtractPath, CString& strResult);
	CString		Md5ToCString(const byte* pMd5);

private:
	HWND			m_hRecvMsgWnd;
	HWND			m_hMainWnd;
	MapAllConfig*	m_pMapAllConfig;
};

